///////////////////////////////////////////////////////////////////////////////////////////////////
// Illusion Ray Development Kit (IDK)           Copyright (c) 2010 ( dimitriy.martynenko@gmail.com )
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-05-22
// Updated : ...
// Licence : NEW BSD
// Info	   : IDK Engine
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once

#include <RenderState.hpp>

namespace Renderer
{
	//
	class TRenderStateOES : public TRenderState
	{
	protected:
	public:
		virtual IDK::GPURenderTexture CreateRenderTexture(uint width, uint height, 
			IDK::Pixel::Type::Enum pixelType,
			IDK::Pixel::Filter::Enum filter);
		virtual void SetRenderTexture(IDK::GPURenderTexture texture, uint index);

		virtual IDK::GPUTexture CreateTexture(IDK::Pixel::Type::Enum type, IDK::Pixel::Filter::Enum filter);
		virtual void SetTexture(IDK::GPUTexture texture, uint index);

		virtual IDK::GPUShader CreateShader(IDK::Stream vertStream, IDK::Stream fragStream, IDK::ShaderParameters parameters);
		virtual void SetShader(IDK::GPUShader shader);
		virtual void SetShaderParameters(IDK::ShaderParameters parameters);
		
		virtual IDK::GPURenderTarget CreateRenderTarget(uint width, uint heigth);
		virtual void SetRenderTarget(IDK::GPURenderTarget rtt);

		virtual IDK::GPUIndexBuffer CreateIndexBuffer(uint indexSize, uint count, HandlePtr data);
		virtual IDK::GPUVertexBuffer CreateVertexBuffer(uint vertexSize, uint count, HandlePtr data);

		virtual void SetIndexBuffer(IDK::GPUIndexBuffer buffer);
		virtual void SetVertexBuffer(IDK::GPUVertexBuffer buffer);

		virtual void DrawIndexVertexData(PrimitiveType::Enum type, uint polyCount);

		//Culling
		virtual void SetCullFace(CullFace::Enum mode);
		virtual void SetDepthTest(DepthTest::Enum mode);

		//Blending
		virtual void SetBlend(Blend::Enum blend);

		//Custom drawable
		virtual void DrawRect(const Math::Rect& rect, const Math::Rect& trect, float z);
		virtual void DrawLine(const Math::Vector3& start,const Math::Vector3& end);

		virtual void ClearBuffers();

		
	};
}